#{extends 'master.html' /}
#{set title:"DigitalBand.ru"/}
#{set isCatalogActive:'active' /}
<div class="page-header">
    <div>
        <h3 class="categoryTitle">Детали заказа</h3>

        <div class="clear"></div>
    </div>
</div>
<div class="page-block">
    <h4>Статус заказа: &{'OrderStatus.'+order.status}</h4>
    <table class="shopping-items">
        <thead>
        <tr>
            <th>&{'Order.summary.table.titleColumn'}</th>
            <th>&{'Order.summary.table.quantityColumn'}</th>
            <th class="item-price">&{'Order.summary.table.unitPriceColumn'}</th>
        </tr>
        </thead>
    #{list items:order.orderItems, as:'orderItem'}
        <tr>

            <td><a href="@{Product.display(orderItem.productId)}">${orderItem.title}</a></td>
            <td>${orderItem.quantity}</td>
            <td class="item-price">${orderItem.subtotal.formatPrice('ru-RU')}</td>
        </tr>
    #{/list}
        <tfoot>
        <td colspan="2">&{'Order.summary.totalSum'}</td>
        <td class="item-price">${order.subtotal.formatPrice('ru-RU')}</td>
        </tfoot>
    </table>
    <br/>
    <br/>

    <div class="user-details">
        <label for="userName">&{'Mails.confirmOrderForAdmin.userName'}</label>

        <div id="userName">${order.userInfo.name}</div>
        <label for="phoneNumber">&{'Mails.confirmOrderForAdmin.phoneNumber'}</label>

        <div id="phoneNumber">${order.userInfo.phoneNumber}</div>
        <label for="address">&{'Mails.confirmOrderForAdmin.address'}</label>

        <div id="address">${order.userInfo.address}</div>

        <label for="email">email:</label>

        <div id="email">${order.userInfo.email}</div>
    </div>
    <fieldset>
        <legend>Статус</legend>
        <a href="@{getCancelForm(order.id)}">Отменить заказ</a>
        <a href="@{getConfirmForm(order.id)}">Подтвердить заказ</a>
        <form method="POST" action="@{Order.postStatus()}" style="display: inline">
            <input type="hidden" value="${order.id}" name="orderId" />
            <input type="hidden" value="done" name="status" />
            <input type="submit" value="Пометить как выполненный" />
        </form>
    </fieldset>

</div>